//
//  UWOHttpService.h
//  basic
//
//  Created by Jack on 2016/12/14.
//  Copyright © 2016年 Jack. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^RequestSuccessBlock)(NSArray *dataArray);
typedef void(^RequestFailerBlock)(NSError *error);
typedef void(^RequestDataStateBlock) (BOOL hasData);//判断有没有数据了

typedef NS_ENUM(NSInteger, RequestType){
    RequestMoreType,    //加载更多
    RequestRefreshType  //下拉刷新
};

@interface UWOHttpService : NSObject

+ (void)GET:(NSString *)URLString
 parameters:(id)parameters
    success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
    failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure;

+ (void)POST:(NSString *)URLString
  parameters:(id)parameters
     success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
     failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure;

+ (void)UPLOAD:(NSString *)URLString parameters:(NSDictionary *)parameters image:(UIImage *)image progress:(void (^)(NSProgress *uploadProgress))progress success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
       failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure;

+ (void)UPLOAD:(NSString *)URLString parameters:(NSDictionary *)parameters imageArray:(NSArray *)imageArray progress:(void (^)(NSProgress *uploadProgress))progress success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
       failure:(void (^)(NSURLSessionDataTask * task, NSError *error))failure;

@end
